package com.mygdx.game;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.mygdx.game.actor.Mario;

/**
 * 超级马丽
 * Created by 80002023 on 2016/8/3.
 */
public class SuperMarioDemo extends Game {

    Stage stage;
    Mario mario;
    Image image;
    @Override
    public void create() {
        stage = new Stage();

//        image = new Image(new Texture(Gdx.files.internal("data/13.jpg")));
//        image.setPosition(0, 170);
        mario = new Mario(100, 190);
        Gdx.input.setInputProcessor(stage);

//        stage.addActor(image);
        stage.addActor(mario);
        stage.addActor(mario.buttonL);
        stage.addActor(mario.buttonR);
    }

    @Override
    public void render() {

        Gdx.gl.glClearColor(1, 1, 1, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        stage.act();
        stage.draw();
    }
}
